package com.zsk.shop.common.constant;

import com.zsk.shop.common.enums.EnumDefaultAvatar;

/**
 * @author 常量
 */
public class Constant {

    /**
     * IM相关
     *
     * @author Ys
     * @date 2021/3/25 14:48
     * @return
     */
    public static final long IM_SDK_APP_ID = 1400496781;
    public static final String IM_SDK_KEY = "60c4fee2329ef09f50396a02d8fd255838a005d1d1b5c5cb2103e26141fa9873";

    public static final String APP_USER = "user";
    public static final String GOP = "gop";
    public static final Long GOP_ADMIN_ROLE_ID = 1L;
    public static final Long GOP_ADMIN_USER_ID = 0L;

    /**
     * 能否通过接口的形式查看短信验证码
     */
    public static final String CAN_SHOW_VERIFICATION_CODE = "CAN_SHOW_VERIFICATION_CODE";
    /**
     * 能通过便捷的形式校验验证码：如果是true/没有值则可以使用，其他false不能使用
     */
    public static final String CAN_USE_SHORT_VERIFICATION_CODE = "CAN_USE_SHORT_VERIFICATION_CODE";

    /**
     * 超时自动收货确认时间
     */
    public static final String OVER_DELIVERY_DAY = "OVER_DELIVERY_DAY";

    /**
     * dataDictionary数据字典中的key(数据字典不能删除)
     *
     * @author Ys
     * @date 2021/3/25 14:48
     * @return
     */
    public static final String TOKEN_INVALID_DAY_KEY = "TOKEN_INVALID_DAY";
    public static final String CLIENT_PUSH_TYPE = "CLIENT_PUSH_TYPE";

    //是否需要校验图形验证码
    public static final String NEED_CHECK_VERIFICATION_IMAGE = "NEED_CHECK_VERIFICATION_IMAGE";

    //实名校验
    public static final String VERIFICATION_SECRET_ID = "AKIDymNjqvqY1FDwQecLp31kESQ9mBLGvLWR";
    public static final String VERIFICATION_SECRET_KEY = "iBPO7bqqb6MM7csvkJekbEcmkTxBBwSi";

    public static final String FINANCE_PWD_KEY = "FINANCE_PWD_KEY";
    public static final String SUB_COMPANY_PWD_KEY = "SUB_COMPANY_PWD_KEY";

    //用户二维码图片存放地址
    public static final String QRCODE_IMG_URL_PROD = "https://oss.zhishangkeapp.com/img/qr_code_img/INVATECODE.png";

    public static String getDefaultAvatar() {
        String url = EnumDefaultAvatar.getRandomUrl();
        return url;
    }

    /**
     * 是否是正式环境
     *
     * @return java.lang.Boolean
     * @author Ys
     * @date 2021/3/25 14:47
     */
    public static Boolean isProd() {
        if (StaticConfigUtil.getEnv().contains(EnvironmentEnum.PROD.getCode()) ||
                StaticConfigUtil.getEnv().contains(EnvironmentEnum.PROD_PRE.getCode())) {
            return true;
        }
        return false;
    }

    /**
     * 是否是本地环境
     *
     * @return java.lang.Boolean
     * @author Ys
     * @date 2021/3/25 14:47
     */
    public static Boolean isLocal() {
        if (StaticConfigUtil.getEnv().equals(EnvironmentEnum.LOCAL.getCode())) {
            return true;
        }
        return false;
    }

    /**
     * 是否是测试环境
     *
     * @return java.lang.Boolean
     * @author Ys
     * @date 2021/3/25 14:48
     */
    public static Boolean isDev() {
        if (StaticConfigUtil.getEnv().contains(EnvironmentEnum.DEV.getCode())
                || StaticConfigUtil.getEnv().contains(EnvironmentEnum.DEV_PRE.getCode())) {
            return true;
        }
        return false;
    }

    public static Boolean isTest() {
        if (StaticConfigUtil.getEnv().contains(EnvironmentEnum.TEST.getCode())) {
            return true;
        }
        return false;
    }

}
